package com.ebt.m.activity.utils;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.ebt.m.activity.WebBaseActivity;

/**
 * Created by allen on 2018/7/31 14:51.
 */
public class WebBaseActivityUtil {
    public static void gotoWeb(Context context, boolean isHideTitle, String title, String url, boolean isHideToolbar, boolean topBackToMain) {
        Intent webIntent = new Intent(context, WebBaseActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString(WebBaseActivity.WEB_TYPE_TITLE, isHideTitle ? "" : title);
        bundle.putInt(WebBaseActivity.WEB_TYPE_FRAGMENT, 111);
        bundle.putBoolean(WebBaseActivity.WEB_TYPE_HIDE_TOOLBAR, isHideToolbar);
        bundle.putString(WebBaseActivity.WEB_TYPE_LINK, url);
        bundle.putBoolean(WebBaseActivity.WEB_TYPE_TOP_BACK_TO_MAIN, topBackToMain);
        webIntent.putExtras(bundle);
        webIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(webIntent);
    }
}
